
<script setup>
import { ref } from 'vue'
const caseTypes = ['民事案件', '刑事案件', '行政案件']
const caseType = ref('')
const setStep = (num) => {
  step.value = num;
}
const step = ref(1)
</script>

<template>
  <div class="step">
    <div @click="setStep(1)" :class="{active:step===1}" style="padding:10px;cursor:pointer;">步骤1，案件类型</div>
    <div @click="setStep(2)" :class="{active:step===2}" style="padding:10px;cursor:pointer;">步骤2，案情描述</div>
    <div @click="setStep(3)" :class="{active:step===3}" style="padding:10px;cursor:pointer;">步骤3，提交材料</div>
  </div>

  <div class="step1" v-if="step===1">
    <h3>案件类型</h3>
    <ul>
      <li v-for="(item,index) in caseTypes" :key="index"  :class="{active:caseType===item}">
        <p @click="caseType=item">{{item}}</p>
      </li>
    </ul>
  </div>
  <div class="step2" v-if="step===2">
    <h3>案情描述</h3>
      <textarea cols="100" rows="10" v-if="step =2"></textarea>
  </div>
  <div class="step3" v-if="step===3">
    <h3>上传证据材料</h3>
    <input type="file" v-if="step = 3"></input>
  </div>
  <div>
    <button v-if="step > 1" @click="step=step-1">上一步</button>
    <button v-if="step<3" @click="step=step+1">下一步</button>
    <button v-if="step===3">提交申请</button>
  </div>

</template>

<style scoped>
.step {
  display: flex;
  justify-content: space-around;
  padding: 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.step div {
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
  color: #475569;
  font-weight: 500;
}

.step div:hover {
  background-color: #e2e8f0;
}

.step div.active {
  background-color: #1e88e5; /* ✅ 改为蓝色 */
  color: white;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.4);
}

.card {
  background: white;
  padding: 25px 30px;
  margin: 20px auto;
  max-width: 700px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.3s ease;
}

h3 {
  margin-top: 0;
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 15px;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

ul li {
  font-size: 15px;
  margin: 8px 0;
  background: #f9f9f9;
  padding: 12px 16px;
  color: #4b5563;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

ul li:hover {
  transform: scale(1.02);
  background-color: #f1f5f9;
}

ul li.active {
  background-color: #cce8f7; /* ✅ 改为蓝色系高亮 */
  color: #1e88e5;
  font-weight: bold;
  border: 1px solid #9ed8f3;
}

textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #ccc;
  resize: vertical;
  height: 120px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
  margin-top: 10px;
}

textarea:focus {
  border-color: #42a9f7; /* ✅ 改为蓝色 */
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 169, 247, 0.2);
}

input[type="file"] {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 14px;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

input[type="file"]:focus {
  outline: none;
  border-color: #42a9f7; /* ✅ 改为蓝色 */
  box-shadow: 0 0 0 3px rgba(66, 169, 247, 0.2);
}

button {
  margin: 10px 10px 0 0;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

button:nth-child(1) {
  background-color: #94a3b8;
}

button:nth-child(2) {
  background-color: #42a9f7; /* ✅ 改为蓝色 */
}

button:nth-child(3) {
  background-color: #00acc1; /* ✅ 改为蓝绿色 */
}

button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .step {
    flex-direction: column;
    align-items: flex-start;
  }

  .card {
    padding: 20px 15px;
    margin: 15px 0;
  }

  ul li {
    font-size: 14px;
    padding: 10px 14px;
  }

  textarea {
    font-size: 14px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>

